home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / hypercrd / hc2_x / tcprogud.sit / TC Prog Guide / card_21180.txt < prev    next >
Text File  |  1991-02-27  |  1KB  |  29 lines

  1. -- card: 21180 from stack: in
  2. -- bmap block id: 0
  3. -- flags: 0000
  4. -- background id: 4755
  5. -- name: 
  6.  
  7.  
  8. -- part contents for background part 6
  9. ----- text -----
  10. 6.  Statements
  11.  
  12. -- part contents for background part 7
  13. ----- text -----
  14. 153
  15.  
  16. -- part contents for background part 4
  17. ----- text -----
  18. The simplest C statement is the NULL STATEMENT, a lone semicolon.  This is occasionally used when a loop body does not require any expressions, as shown later in this chapter.  An EXPRESSION STATEMENT is an expression followed by a semicolon:
  19.  
  20.     2 + 2;        /* useless statement */
  21.  
  22. Notice that the value of the expression is ignored.  A more useful such statement is one whose expression has a "side effect" like assigning a value or evaluating a function!
  23.  
  24.     int   a;         /* declaration */
  25.     a = 2 + 2;
  26.     printf("result: %d\n",a);
  27.  
  28. This chapter begins with a discussion on grouping expression statements and goes on to discuss C's control flow statements for conditional execution and looping.  The            'return' statement to terminate a function was already discussed in Chapter 3.
  29.